import {menuList} from '../../../util/request/api'
// 菜单的状态管理
const state={
    menulist=[]
}
const getter={
    getMenuList(state){
        return state.menulist
    }
}
const mutations={
    REQ_MENULIST(state,payload){
        state.menulist = payload
    }
}
const actions={
    // 修改菜单列表
    getMenuAction({commit}){
        menuList()
        .then(res=>{
            if (res.code==200) {
                commit('REQ_MENULIST',res.list)
            }
        })
    }
}
export default{
    state,
    getter,
    mutations,
    actions,
    namespace:true
}